home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 16 / CU Amiga Magazine's Super CD-ROM 16 (1997-10-16)(EMAP Images)(GB)[!][issue 1997-11].iso / CUCD / Online / HBBS / Source / Common / defines.h < prev    next >
Text File  |  1997-09-03  |  12KB  |  353 lines

  1. // defines for askmsg->flags for CONTROL program
  2. #define ASK_BBSGLOBAL 1
  3.  
  4. // defines for askmsg->flags for NODE program
  5. #define ASK_STATUS 20
  6.  
  7.  
  8. // error messages for HBBS_LogError()
  9.  
  10. #define ERR_NO_ERROR 0
  11. #define ERR_ERROR_OPENING 1
  12. #define ERR_ERROR_READING 2
  13. #define ERR_ERROR_WRITING 3
  14. #define ERR_GENERAL 4
  15. #define ERR_NODESETTINGS 5
  16. #define ERR_DOORTIMEOUT 6
  17. #define ERR_INFO 7
  18.  
  19. // if ya change any of the errors here don't forget to update the array
  20. // of error msg strings in errors.h
  21.  
  22. #define TYPE_NONE 0
  23. #define TYPE_FATAL 1
  24. #define TYPE_CRITICAL 2
  25. #define TYPE_IMPORTANT 3
  26. #define TYPE_WARNING 4
  27. #define TYPE_DONTCARE 5
  28. #define TYPE_MEMORY 6 // a bit different to the above types...
  29. #define TYPE_INFO 7
  30.  
  31. #define BIG_STR 1024 // ppplenty long enough.. and just to be on the (very) safe
  32.                      // side of long sprintf's :-)
  33.  
  34.  
  35. // if you update/change/add to this then update HBBS_GetSetting() in HBBSCommon.c with changes
  36. #define VTYPE_TIME 1
  37. #define VTYPE_SMALLNUM 2
  38. #define VTYPE_BIGNUM 3
  39. #define VTYPE_STRING 4
  40. #define VTYPE_BOOL 5
  41. #define VTYPE_STRINGLIST 6
  42. #define VTYPE_FLAGS 7
  43. #define VTYPE_PATH 8
  44. #define VTYPE_PATHLIST 9
  45. #define VTYPE_WORD 10
  46. #define VTYPE_DATE 11
  47.  
  48. #define OPT_SINGLE 0
  49. #define OPT_MULTI 1
  50.  
  51. // possible node status's
  52.  
  53. #define STAT_CLOSED 0
  54. #define STAT_LOADING 1
  55. #define STAT_INITIALIZING 2
  56. #define STAT_READY 3
  57. #define STAT_ONLINE 4
  58. #define STAT_CLOSING 5
  59.  
  60. // gets sent to Node Program when you want a node to shutdown..
  61.  
  62. #define STAT_REQUESTCLOSE 6
  63.  
  64. // send to node program if you want it to open or close it's window (NOT UserScreen tho!, just the node control window)
  65. #define STAT_OPENWINDOW 7
  66. #define STAT_CLOSEWINDOW 8
  67. // send to node program if you want it to open or close it's UserScreen
  68. #define STAT_OPENSCREEN 9
  69. #define STAT_CLOSESCREEN 10
  70.  
  71. // login types..
  72.  
  73. #define LOGIN_NONE   0
  74. #define LOGIN_REMOTE 1
  75. #define LOGIN_LOCAL  2
  76.  
  77. // possible flags for displaying information in the ctrl window's status bar!
  78.  
  79. #define UPD_NODESTATUS 1
  80.  
  81. // define some string lengths
  82.  
  83. #define LEN_NODESTATNAME  10
  84. #define LEN_CURRENTLINE   1024  // should be PLENTY..
  85. #define LEN_MAXDOORRETURN 255
  86. #define LEN_DATESTR       12 // DD-MMM-YYYY + Terminator
  87. #define LEN_TIMESTR       9 // HH:MM:SS + Terminator
  88.  
  89. // defines for request message types
  90.  
  91. #define REQ_UPDATEINFO 1 // tells control program to update the currently displayed
  92.                          // list above the Information gadget (callers/dls/ul's....)
  93.  
  94.  
  95. // message types
  96.  
  97. //#define mtype_ASK 1
  98. #define mtype_STATUS 2
  99. #define mtype_DOORACTIVITY 3
  100. #define mtype_DOORIO 4
  101. #define mtype_REQUEST 5
  102. #define mtype_CHECK 6
  103.  
  104. // door status message types..
  105.  
  106. #define DMSG_DOORSTARTED 1
  107. #define DMSG_DOORFINISHED 2
  108.  
  109. // door io message types
  110.  
  111. #define DOORIO_WRITECONSTR          1
  112. #define DOORIO_WRITECONDATA         2
  113. #define DOORIO_WRITESERSTR          3
  114. #define DOORIO_WRITESERDATA         4
  115. #define DOORIO_WRITESTR             5
  116. #define DOORIO_GETLINE              6
  117. #define DOORIO_SYSTEMDOOR           7
  118. #define DOORIO_USERDOOR             8
  119. #define DOORIO_HANGUP               9
  120. #define DOORIO_DISPLAYSCREEN        10
  121. #define DOORIO_DISPLAYSPECIALSCREEN 11
  122. #define DOORIO_PAUSEPROMPT          12
  123. #define DOORIO_ADDLASTUPLOAD        13
  124. #define DOORIO_CONTINUEPROMPT       14
  125. #define DOORIO_MENUPROMPT           15
  126. #define DOORIO_CHECKRAW             16
  127. #define DOORIO_CHANGECONSOLEMODE    17
  128. #define DOORIO_ADDLASTDOWNLOAD      18
  129. // getline flags!
  130.  
  131. #define GL_NONE         0    // default
  132. #define GL_HISTORY      1    // if set history is enabled (up/down cursor keys)
  133. #define GL_LINEWRAP     2    // if maxlen is reached then data back to the last ' ' character is copied to N_ND->CurrentLineWrap and returns immediately
  134. #define GL_IMMEDIATE    4    // returns when maxlen is reached
  135. #define GL_NORETURN     8    // does not print a cr+lf when a) reached maxlen or b) timeout or c) return press
  136. #define GL_EDIT         16   // enables cursor left/right and backspace/delete
  137. #define GL_DISPLAY      32   // display chars (don't specify for "Press [return] to contine" type prompts)
  138. #define GL_SYSOP        64   // does not write to, or read from, the serial port
  139. #define GL_USECHARS     128  // see N_ND->CharsAllowed
  140. #define GL_NOBEEP       256  // use with GL_USECHARS if you don't want a beep when
  141.                              // the presses a key not in N_ND->CharsAllowed
  142. #define GL_NOOLM        512  // (No OLM) if set olm's will not inturrpt the user
  143. #define GL_NODISTURB    1024 // Lets you use things like "Enter ID: [    ]" with out the ] moving
  144. #define GL_CVTUPPER     2048 // converts input chars to uppercase as the keys are pressed!
  145. #define GL_NOINACTIVITY 4096 //Disables Inactivity checking (primarily for use with awaitconnect door)
  146. #define GL_COUNTDOWN    8192 //Disables a countdown if used with a timeout value!
  147.  
  148. // pass this to LoadNodeDataSettings if you want the hbbs:nodes/nodeglobal file
  149.  
  150. #define NODE_GLOBAL 200000
  151.  
  152. #define IN_CONSOLE 1
  153. #define IN_SERIAL 2
  154.  
  155. #define GET_ANYWHERE 0
  156. #define GET_SERIAL 1
  157. #define GET_CONSOLE 2
  158.  
  159. #define DEF_CONBUFLEN 2048  // default lenghts used to allocate NodeData->ConBuffer
  160. #define DEF_SERBUFLEN 2048  // default lenghts used to allocate NodeData->SerBuffer
  161.   // note: these may be reallocated by the program to a different length,
  162.   // so check NodeData->Con/SerBufferLen for actual current length!
  163.  
  164. #define IN_NOTHING 0       // (reserved)
  165.  
  166. #define IN_GOTLINE 1       // returned if function actually got a line of
  167.                            // text
  168. #define IN_LOSSCARRIER 2   // retuned only if N_ND->Logintype!=LOGIN_NONE
  169.                            // or sysop logged user off! :-)
  170. #define IN_LOGIN 3         // returned if N_ND->LoginType==LOGIN_NONE and
  171.                            // sysop wants to local login
  172. #define IN_SHUTDOWN 4      // will never be returned to a door,
  173.                            // only to AwaitConnect();
  174.                            // due the the fact that N_ND->RequestShutdown can only
  175.                            // be set if there's no user online and therefore
  176.                            // no door can be running!
  177. #define IN_IMMEDIATE 5
  178.  
  179. #define IN_TERMINAL 6
  180.  
  181. #define IN_TIMEOUT 7
  182.  
  183. #define IN_ENDCHAT 8
  184.  
  185. #define IN_DISPLAYAWAIT 9  // if sysop presses F4 at await connect prompt you'll get this..
  186.  
  187. #define IN_DIALOUT 10  // if sysop presses F4 at await connect prompt you'll get this..
  188.  
  189.  
  190. #define DEF_WINSIG         (1L << NodeWnd->UserPort->mp_SigBit)
  191. #define DEF_CONWINSIG      (1L << N_ND->ConWin->UserPort->mp_SigBit)
  192. #define DEF_INFOWINSIG     (1L << InfoWin->UserPort->mp_SigBit)
  193. #define DEF_SETTINGSWINSIG (1L << SettingsWin->UserPort->mp_SigBit)
  194. #define DEF_CONSIG         (1L << N_ND->ConRPort->mp_SigBit)
  195. #define DEF_SERSIG         (1L << N_ND->SerPort->mp_SigBit)
  196. #define DEF_PORTSIG        (1L << N_ND->NodePort->mp_SigBit)
  197. #define DEF_TIMERSIG       (1L << N_ND->NodeTimer->TimerPort->mp_SigBit)
  198.  
  199. // the lengths of the strings in the user data file..
  200.  
  201. // update user editor GUI string max chars values if you modify these..
  202.  
  203. #define LEN_HANDLE          25
  204. #define LEN_REALNAME        30
  205. #define LEN_GROUP           30
  206. #define LEN_GEOLOCATION     20
  207. #define LEN_COUNTRY         20
  208. #define LEN_PHONENUMBER     20
  209. #define LEN_PASSWORD        20
  210. #define LEN_COMPUTERTYPE    40
  211. #define LEN_SENTBY          48 // *C* needs to be 45
  212. #define LEN_TIMEACCESS      32 // same as max filename length!
  213. #define LEN_CONFACCESSFILE  32
  214. #define LEN_LEECHACCESSFILE 32
  215. #define MAX_ACCESSSETTINGS        4096       // 4k is not unreasonably large..
  216.                                              // nor to small..  think about it,
  217.                                              // are we really going to have
  218.                                              // 4096 access flags ??
  219.  
  220. // tells node what to update..
  221.  
  222. #define UPD_NAME     1
  223. #define UPD_GROUP    2
  224. #define UPD_ACTION   3
  225. #define UPD_CPSBAUD  4
  226.  
  227. // string lengths for action
  228.  
  229. #define MAX_ACTION_LEN 29
  230. #define MAX_CPSBAUD_LEN 8
  231. #define MAX_GROUP_LEN 20
  232. #define MAX_NAME_LEN 20
  233.  
  234. #define TIMEOUT_DOORLOAD 10 // ten seconds..
  235.  
  236.  
  237. #define OS_ONLINE TRUE
  238. #define OS_OFFLINE FALSE
  239.  
  240. // flags for UserData->Status
  241.  
  242. #define USER_NEW          'N'
  243. #define USER_VALIDATED    'V'
  244. #define USER_DELETED      'D' // may be reinstated
  245. #define USER_INACTIVE     'I' // *N* users may login to inactive accounts at the moment,
  246.                               // this setting just helps sysops find inactive accounts
  247. #define USER_LOGINSDENIED 'L'
  248. #define USER_OVERWRITABLE 'O' // all related mail stuff, files, stats should be gone if this is set..
  249.  
  250.  
  251. // screen names,  use these when calling DOOR_DisplaySpecialScreen()
  252.  
  253. #define SSCREEN_PRIVATESYSTEM "PRIVATESYSTEM"
  254. #define SSCREEN_PRIVATENODE "PRIVATENODE"
  255. #define SSCREEN_BBSTITLE "BBSTITLE"
  256. #define SSCREEN_NONEWAT_ALL "NONEWAT_ALL"
  257. #define SSCREEN_NONEWAT_THISTIME "NONEWAT_THISTIME"
  258. #define SSCREEN_GUESTLOGIN "GUESTLOGIN"
  259. #define SSCREEN_JOINED "JOINED"
  260. #define SSCREEN_LOGINLOGO "LOGINLOGO"
  261. #define SSCREEN_BULLETIN "BULLETIN"
  262. #define SSCREEN_CONFBULLETIN "CONFBULLETIN"
  263.  
  264. // user level types..
  265.  
  266. #define USERTYPE_NORMAL 'N'
  267. #define USERTYPE_EXPERT 'X'
  268.  
  269. // protocol directional types
  270.  
  271. #define PTYPE_UNIDIRECTIONAL 1
  272. #define PTYPE_BIDIRECTIONAL 2
  273.  
  274. // node flags             bits
  275.  
  276. #define NFLG_NONE         0
  277. #define NFLG_BLOCKSERIAL  1
  278. #define NFLG_PAGED        2
  279. #define NFLG_CTRLC        4
  280. #define NFLG_OLMSWAITING  8
  281. #define NFLG_HANDLINGOLM  16
  282.  
  283. // flags for DOOR_ContinuePrompt()
  284.  
  285. #define DEFAULT_NONE 0
  286. #define DEFAULT_YES  1
  287. #define DEFAULT_NO   2
  288. #define DCP_ADDYN    4
  289.  
  290.  
  291. // used in N_ND->Actions, to set an access flag just use the follow:
  292. //
  293. // N_ND->Actions[ACTN_<action>]=ACTC_<action>;
  294. //
  295. // where <action> is one of the names below...
  296. // if you add actions you must recomile the node program!
  297.  
  298. #define ACTC_NONE                ' '   // all ACTC's default to this
  299.  
  300. #define ACTN_HACK                0
  301. #define ACTC_HACK                'H'   // user failed to enter a correct password
  302. #define ACTN_CARRIERLOST         1
  303. #define ACTC_CARRIERLOST         'L'   // user lost carrier!
  304. #define ACTN_FILESCAN            2
  305. #define ACTC_FILESCAN            'S'   // user scanned one or more filelists (FR,N,Z or F)
  306. #define ACTN_WROTEMAIL           3
  307. #define ACTC_WROTEMAIL           'W'   // user wrote some mail
  308. #define ACTN_READMAIL            4
  309. #define ACTC_READMAIL            'R'   // user read some mail
  310. #define ACTN_PAGED               5
  311. #define ACTC_PAGED               'P'   // user used the 'O' door to page the sysop
  312. #define ACTN_UPLOAD              6
  313. #define ACTC_UPLOAD              'U'   // user uploaded files
  314. #define ACTN_FAILEDUPLOAD        7
  315. #define ACTC_FAILEDUPLOAD        'u'   // user failed an upload transfer
  316. #define ACTN_DOWNLOAD            8
  317. #define ACTC_DOWNLOAD            'D'   // user downloaded a file
  318. #define ACTN_FAILEDDOWNLOAD      9
  319. #define ACTC_FAILEDDOWNLOAD      'd'   // user failed to dow3nload 1 or more files
  320. #define ACTN_CHANGEDSETTINGS     10
  321. #define ACTC_CHANGEDSETTINGS     'C'   // user uses a 'W' type door
  322. #define ACTN_CHATTEDTOSYSOP      11
  323. #define ACTC_CHATTEDTOSYSOP      '1'   // sysop chatted to the user!  (via SysopChat door)
  324. #define ACTN_NUKEDFILES          12
  325. #define ACTC_NUKEDFILES          'X'   // user used the nuker!
  326. #define ACTN_NEWUSER             13
  327. #define ACTC_NEWUSER             'N'   // user is a new user
  328. #define ACTN_USEDSHELL           14
  329. #define ACTC_USEDSHELL           '!'   // user used a bbs shell to access the bbs computer directly
  330. #define ACTN_INACTIVITYTIMEOUT   15
  331. #define ACTC_INACTIVITYTIMEOUT   'I'   // user used a bbs shell to access the bbs computer directly
  332.  
  333. #define LAST_ACTION              16    // must be last ACTN_blah + 1
  334. #define LEN_ACTIONS              150   // total number of actions, LEN_ACTIONS+1 is allocated N_ND->Actions[LEN_ACTIONS] is always 0 (null terminated string..)
  335.  
  336. // flags for LoadConfig()     bits
  337.  
  338. #define LCFG_NONE             0
  339. #define LCFG_NOSTRIPCOMMENTS  1
  340. #define LCFG_NOSTRIPSPACES    2
  341.  
  342. // flags for CheckRaw()       bits
  343.  
  344. #define CR_NONE               0
  345. #define CR_NOSERIAL           1
  346. #define CR_NOCONSOLE          2
  347.  
  348. // WARNING: Never wait on CheckRaw() using only CR_NOSERIAL when the login type
  349. //          is LOGIN_LOCAL otherwise you'll end up in a permanent loop.
  350.  
  351. #define LEN_DIZWIDTH 45 // used to be 48 chars and not defined anywhere...
  352.  
  353.